'use strict';

module.exports = {
  up: (queryInterface, Sequelize) => {
    /*
      Add altering commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.createTable('users', { id: Sequelize.INTEGER });
    */
    // 添加age字段
    return queryInterface.addColumn('Users', 'age',{
        type: Sequelize.TINYINT,
        allowNull: false,
        defaultValue: 0
    })
  },

  down: (queryInterface, Sequelize) => {
    /*
      Add reverting commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.dropTable('users');
    */

    // 删除age字段
    return queryInterface.removeColumn('Users', 'age')
  }
};
